home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / gfront11.lha / GUIFront / Demos / Source / threebut2.c < prev    next >
C/C++ Source or Header  |  1994-11-01  |  3KB  |  84 lines

  1.  
  2. /* ThreeBut.c - Three simple buttons - with a frame
  3.  *
  4. /* This is a GUIFront example GUI. To build an example, compile and link this
  5.  * file with Generic.o (also supplied).
  6.  * Everything prefixed with DEMO_ is exported to Generic.o.
  7.  */
  8.  
  9. #include <libraries/guifront.h>
  10.  
  11. /* This example is exactly like threebut.c, only the three gadgets now have
  12.  * a nice, named frame.
  13.  */
  14.  
  15. /* First, some Gadget ID's */
  16.  
  17. enum
  18. {
  19.     GID_BUTTON1,
  20.     GID_BUTTON2,
  21.     GID_BUTTON3,
  22. };
  23.  
  24. /* Now, the GadgetSpec's we'll be needing for this GUI */
  25.  
  26. static GadgetSpec gadgetspecs[] =
  27. {
  28.     {BUTTON_KIND, 0,0, {0,0,0,0, "_A button",       NULL, GID_BUTTON1, PLACETEXT_IN}, NULL, GS_DefaultTags},
  29.     {BUTTON_KIND, 0,0, {0,0,0,0, "Another _button", NULL, GID_BUTTON2, PLACETEXT_IN}, NULL, GS_DefaultTags},
  30.     {BUTTON_KIND, 0,0, {0,0,0,0, "_One more",       NULL, GID_BUTTON3, PLACETEXT_IN}, NULL, GS_DefaultTags},
  31. };
  32.  
  33. /* Now, we group all of these GadgetSpecs into an array of pointers, so the
  34.  * layout engine can locate gadgets merely by their Gadget IDs.
  35.  */
  36.  
  37. GadgetSpec *DEMO_GadgetSpecList[] =
  38. {
  39.     &gadgetspecs[0], &gadgetspecs[1], &gadgetspecs[2], NULL
  40. };
  41.  
  42. /* Finally, the layout tag list itself. This is where most of the work is
  43.  * done. This list completely describes how the above gadgets are arranged
  44.  * in groups in the GUI.
  45.  */
  46.  
  47. ULONG DEMO_LayoutList[] =
  48. {
  49.     GUIL_Flags, GUILF_PropShare | GUILF_EqualWidth,
  50.  
  51.     GUIL_FrameType, GUILFT_Ridge,      /* Add a Ridge frame around this group */
  52.     GUIL_FrameHeadline, "Frame",       /* Put a title on the frame as well    */
  53.  
  54.     GUIL_GadgetSpecID, GID_BUTTON1,
  55.     GUIL_GadgetSpecID, GID_BUTTON2,
  56.     GUIL_GadgetSpecID, GID_BUTTON3,
  57.  
  58.     TAG_DONE,
  59. };
  60.  
  61. /* Obligatory version tag */
  62.  
  63. static const char ver[] = "$VER: ThreeBut2 1.0 " __AMIGADATE__;
  64.  
  65. /* Now, some globals used by Generic.o during the call to GF_CreateGUIA() */
  66.  
  67. /* The initial orientation of the GUI. In this case, it's vertical. This means
  68.  * the three button gadgets, which we just grouped together, will be placed
  69.  * in a vertical group. Alternatively, we could have used GUIL_HorizGroup
  70.  * to make the initial orientation horizontal (surprise :-)
  71.  */
  72.  
  73. int DEMO_InitialOrientation = GUIL_VertGroup;
  74.  
  75. STRPTR DEMO_WindowTitle = "Threebut2 GUI";
  76. STRPTR DEMO_AppID       = "Threebut2";
  77.  
  78. STRPTR DEMO_Version     = "1.0",
  79.        DEMO_LongDesc    = "Demo program - Three buttons with frame",
  80.        DEMO_Author      = "Michael Berg",
  81.        DEMO_Date        = __AMIGADATE__;
  82.  
  83. BOOL   DEMO_Backfill    = FALSE;
  84.